import { reqShopcartList } from "@/api/shopcart";

export default {
  state: {
    shopcartList: [],
  },
  mutations: {
    UPDATE_SHOPCARTLIST(state, shopcartList) {
      state.shopcartList = shopcartList;
    },
  },
  actions: {
    // 获取购物车列表
    async getShopcartList({ commit }) {
      const res = await reqShopcartList();
      // console.log(res);
      commit("UPDATE_SHOPCARTLIST", res);
    },
  },
};

